#pragma once

#define TCP_BUFFER_SIZE 1024

class FTcpExample : FRunnable
{
protected:
	bool bIsReceiving;
	FSocket* NativeSocket;
	FRunnableThread* ListenThread;


	virtual uint32 Run() override;
	void Abort();

public:
	FTcpExample();
	virtual ~FTcpExample() override;
	
	bool Connect(const FString& IP, const int32 Port);
	void StartListen();
	void Close();
	void SendMsg(const FString& Msg) const;
};
